/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.StateVariables.impl;

import EA_Model.IEC61970.StateVariables.StateVariablesPackage;
import EA_Model.IEC61970.StateVariables.SvStatus;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Sv Status</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.StateVariables.impl.SvStatusImpl#getInService <em>In Service</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class SvStatusImpl extends StateVariableImpl implements SvStatus {
	/**
	 * The cached value of the '{@link #getInService() <em>In Service</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getInService()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Boolean inService;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected SvStatusImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return StateVariablesPackage.Literals.SV_STATUS;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Boolean getInService() {
		if (inService != null && inService.eIsProxy()) {
			InternalEObject oldInService = (InternalEObject)inService;
			inService = (EA_Model.IEC61970.Domain.Boolean)eResolveProxy(oldInService);
			if (inService != oldInService) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, StateVariablesPackage.SV_STATUS__IN_SERVICE, oldInService, inService));
			}
		}
		return inService;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Boolean basicGetInService() {
		return inService;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setInService(EA_Model.IEC61970.Domain.Boolean newInService) {
		EA_Model.IEC61970.Domain.Boolean oldInService = inService;
		inService = newInService;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, StateVariablesPackage.SV_STATUS__IN_SERVICE, oldInService, inService));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case StateVariablesPackage.SV_STATUS__IN_SERVICE:
				if (resolve) return getInService();
				return basicGetInService();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case StateVariablesPackage.SV_STATUS__IN_SERVICE:
				setInService((EA_Model.IEC61970.Domain.Boolean)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case StateVariablesPackage.SV_STATUS__IN_SERVICE:
				setInService((EA_Model.IEC61970.Domain.Boolean)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case StateVariablesPackage.SV_STATUS__IN_SERVICE:
				return inService != null;
		}
		return super.eIsSet(featureID);
	}

} //SvStatusImpl
